﻿@model IEnumerable<Shop.Models.Ad>

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutList.cshtml";
}


<table class="table">
    <tr>
        <th>
            
            @Html.DisplayNameFor(model => model.Picture)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Href)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.BeginTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.EndTime)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.State)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            <img src="@item.Picture" width="150" />
            
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Href)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BeginTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EndTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.State)
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}
</table>
<form action="/admin/ad/create" enctype="multipart/form-data" method="post" width="100%">
    <span>图片：</span><input type="file" name="file" value="" />
     <span>URL:</span> <input type="text" name="Href" value="" />
    <button>添加</button>
</form>
